import React, { Component } from 'react'
import styles from './index.less'
import TelBookGroup from './TelBookGroup.js'
import TelBookContent from './TelBookContent.js'
import MyModal from './MyModal.js'
import { connect } from 'dva'

@connect(({ telBookEnterprise, loading }) => ({ 
    telBookList: telBookEnterprise.telBookList,
    addShow: telBookEnterprise.addShow,
    selectedNode: telBookEnterprise.selectedNode,
    upAddInfo: telBookEnterprise.upAddInfo,
    telList: telBookEnterprise.telList,
    page: telBookEnterprise.page,
    total: telBookEnterprise.total,
    fetchSelTelBookByEnterpriseLoading: loading.effects['telBookEnterprise/fetchSelTelBookByEnterprise'],
    selName: telBookEnterprise.selName,
    selPhone: telBookEnterprise.selPhone
    //fetchSelLv1ByUserIdLoading: loading.effects['telBook/fetchSelLv1ByUserId'],
}))
export default class PersonalView extends Component {
    

    render() {
        return (
            <div className={styles.content}>
                {/* 通讯录分组 */}
                <TelBookGroup {...this.props} />
                {/* 通讯录内容 */}
                <TelBookContent {...this.props} />
                {/* 添加修改弹出框 */}
                <MyModal {...this.props}/>
            </div>
        )
    }
    componentDidMount(){
        const { dispatch } = this.props
        dispatch({
            type: 'telBookEnterprise/fetchSelLv1ByType2',
        })
    }
}
